#pragma once

#include <string>
#include <unordered_map>
#include "error.h"

class MemDB {
public:
    MemDB(){}
    ~MemDB(){}

    ErrCode Get(const std::string &key, std::string *value);
    ErrCode Set(const std::string &key, const std::string &value, int ttl_ms = 0, bool ex = false);
    ErrCode Del(const std::string &key);
    // ErrCode Incr(const std::string &key, int delta);
    // ErrCode Expire(const std::string &key, int ttl_ms);

private:
    std::unordered_map<std::string, std::string> _cache;
};